<template>
  <div class="home">
    <div class="anti_">
      <img ref="img_" :src="timg" alt="" class="el_img hige">
      <input
        ref="list"
        type="file"
        name="thumbnail"
        accept="image/jpeg image/x-png"
        class=" pic_add hige"
        @change="onFileChange($event)"
      >
    </div>
  </div>
</template>
<script>
import {
  mapGetters
} from 'vuex'
import timg from '~/timg.jpg'
export default {
  components: {
    mapGetters
  },
  props: {
    imgPathName: {
      type: String
    },
    imgID: {
      type: String
    }
  },
  data() {
    return {
      timg,
      input_e: ''
      // IDTRACING:this.$ENV.TRACING,
    }
  },
  watch: {},
  methods: {

    onFileChange(e) {
      if (this.$oneselfFn.IMAGEVAL(e)) {
        this.input_e = e // delete()
        this.$img.SetParm(this.$ENV.TRACING + this.ImgID + this.ImgPathName, e).create().then((res) => {
          console.info(res)
          this.timg = res.imageURL + '/' + res.imagePath
        })
          .catch((err) => {
            if (err.code) {
              this.$message.error(err.Massage)
            }
          })
      } else {
        this.$notify({
          title: '警告',
          message: '图片大小不能超过2M',
          type: 'warning'
        })
      }
    },
    addimage() {}
  },
  computed: {
    addimg() {
      return this.$refs.InputConment
    },
    ...mapGetters([
      'qiyeenterprise'
    ])
  },
  created() {

  },
  mounted() {
    if (this.qiyeenterprise.id) {

    }
    // 生命周期
  }
}
</script>
<style scoped>
    .home {
        width: 100%;
        height: 100%;
    }
    .anti_ {
      margin: auto;
      width: 50%;
      height: 200px;
    }

    .anti_ img {
      width: 100%;
      display: block;
      background-size: 100% 100%;
    }
    .hige{
      height: 160px;
    }
    .pic_add {
      width: 100%;
      position: relative;
      bottom: 160px;
      z-index: 9999;
      opacity: 0;
    }

</style>
